package com.invengo.module_robot.ui.fragment.advert;


import me.tatarka.bindingcollectionadapter2.BindingViewPagerAdapter;

public class AdvertPagerAdapter extends BindingViewPagerAdapter {

    @Override
    public float getPageWidth(int position) {
        return 0.98f;
    }

    @Override
    public int getCount() {
        return dataSize==0?0:Integer.MAX_VALUE;
    }

//    @NonNull
//    @Override
//    public Object instantiateItem(@NonNull ViewGroup container, int position) {
//        int positions1 = position;
//        if (dataSize==0)
//            return super.instantiateItem(container,position);
//        positions1%=dataSize;
//        return super.instantiateItem(container, positions1);
//    }

    private int dataSize;
    public void datas(int size) {
        this.dataSize =size;
    }

    public int getDataSize() {
        return dataSize;
    }
}